package day04;

public class SwitchCaseDemo {
    public static void main(String[] args) {
        int num =4;
        switch (num){ //byte short char int String和枚举
            case 1:  //if(num==1)
                System.out.println(111);
                break;
            case 2: //以此为入口
                System.out.println(222);
                break;
            case 3:
                System.out.println(333);
                break;
            default:  //所有case都没匹配才会单独执行,default 放哪里都行，都是先走case，但要注意break
                System.out.println(5);
                //输出结果222
                //333
                //5
        }
    }
}
